<template>

    <q-table
    title="MyTable"
    :rows="tableData"
    :columns="columns"
    row-key="fromstr" />
 
  
</template>



<script>

import axios from 'axios'

// import { createDOMCompilerError } from '@vue/compiler-dom';





export default {
  

data () {
  return {
    tableData: [],      
      columns: [
        { name: 'fromstr', align: 'center', label: 'fromstr', field: 'fromstr'},
        { name: 'roomid', label: 'roomid', field: 'roomid'},
        { name: 'msgtime', label: 'msgtime', field: 'msgtime' },
        { name: 'msgtype', label: 'msgtype', field: 'msgtype' },
        { name: 'text', label: 'text', field: 'text' },
        { name: 'image', label: 'image', field: 'image' }
        
      ],
    
      
    }
},
mounted () {
    this.fetchData();
  },
  methods: {
    fetchData(){
      var form3 = {
        pageSize:10,
        pageNum:1,
        orderBy:"auto",
        beginTime:"auto",
        endTime:"auto",

      }
      var self = this;
      axios.post('http://172.51.3.121:8080/readWXRecord', form3)
        .then(function (response) {
          // handle success
          console.log(response);
          // responseMessage.value  = response.data.data.retStr;
          // this.tableData = response.data.data
          self.tableData = response.data.data.rows;

        })
        .catch(function (error) {
          // handle error
          console.log(error);
          
        })
        .then(function () {
          // always executed
          // $q.notify({
          //   color: 'green-4',
          //   textColor: 'white',
          //   icon: 'cloud_done',
          //   message: 'Submitted'
          // })

         
        });
    }
  },





  




}


</script>


